<%@ include file="/common/taglibs.jsp"%>

<head>
    <title><fmt:message key="vehiculeList.title"/></title>
    <meta name="heading" content="<fmt:message key='vehiculeList.heading'/>"/>
    <meta name="menu" content="VehiculeMenu"/>
</head>

<div id="search">
<form method="get" action="${ctx}/vehicules" id="searchForm">
    <input type="text" size="20" name="q" id="query" value="${param.q}"
           placeholder="Enter search terms..."/>
    <input type="submit" value="<fmt:message key="button.search"/>"/>
</form>
</div>

<input type="button" style="margin-right: 5px" class="button" onclick="location.href='<c:url value="/editVehicule"/>'" value="<fmt:message key="button.add"/>"/>
<input type="button" class="button" onclick="location.href='<c:url value="/mainMenu"/>'" value="<fmt:message key="button.done"/>"/>

<display:table name="vehicules" class="table" requestURI="" id="vehiculeList" export="true" pagesize="25">
    <display:column property="id" sortable="true" href="editVehicule" media="html"
        paramId="id" paramProperty="id" titleKey="vehicule.id"/>
    <display:column property="id" media="csv excel xml pdf" titleKey="vehicule.id"/>
    <display:column sortProperty="accidente" sortable="true" titleKey="vehicule.accidente">
        <input type="checkbox" disabled="disabled" <c:if test="${vehiculeList.accidente}">checked="checked"</c:if>/>
    </display:column>
    <display:column sortProperty="anneeSortie" sortable="true" titleKey="vehicule.anneeSortie">
         <fmt:formatDate value="${vehiculeList.anneeSortie}" pattern="${datePattern}"/>
    </display:column>
    <display:column property="boiteVitesse" sortable="true" titleKey="vehicule.boiteVitesse"/>
    <display:column property="couleurExterieure" sortable="true" titleKey="vehicule.couleurExterieure"/>
    <display:column property="cylindre" sortable="true" titleKey="vehicule.cylindre"/>
    <display:column sortProperty="dateDedouanement" sortable="true" titleKey="vehicule.dateDedouanement">
         <fmt:formatDate value="${vehiculeList.dateDedouanement}" pattern="${datePattern}"/>
    </display:column>
    <display:column sortProperty="dedouane" sortable="true" titleKey="vehicule.dedouane">
        <input type="checkbox" disabled="disabled" <c:if test="${vehiculeList.dedouane}">checked="checked"</c:if>/>
    </display:column>
    <display:column property="energie" sortable="true" titleKey="vehicule.energie"/>
    <display:column property="kilometrage" sortable="true" titleKey="vehicule.kilometrage"/>
    <display:column property="modele" sortable="true" titleKey="vehicule.modele"/>
    <display:column property="peinture" sortable="true" titleKey="vehicule.peinture"/>
    <display:column property="portes" sortable="true" titleKey="vehicule.portes"/>
    <display:column sortProperty="premiereMain" sortable="true" titleKey="vehicule.premiereMain">
        <input type="checkbox" disabled="disabled" <c:if test="${vehiculeList.premiereMain}">checked="checked"</c:if>/>
    </display:column>
    <display:column property="prixDemande" sortable="true" titleKey="vehicule.prixDemande"/>
    <display:column property="puissanceFiscale" sortable="true" titleKey="vehicule.puissanceFiscale"/>
    <display:column property="texture" sortable="true" titleKey="vehicule.texture"/>

    <display:setProperty name="paging.banner.item_name"><fmt:message key="vehiculeList.vehicule"/></display:setProperty>
    <display:setProperty name="paging.banner.items_name"><fmt:message key="vehiculeList.vehicules"/></display:setProperty>

    <display:setProperty name="export.excel.filename"><fmt:message key="vehiculeList.title"/>.xls</display:setProperty>
    <display:setProperty name="export.csv.filename"><fmt:message key="vehiculeList.title"/>.csv</display:setProperty>
    <display:setProperty name="export.pdf.filename"><fmt:message key="vehiculeList.title"/>.pdf</display:setProperty>
</display:table>

<input type="button" style="margin-right: 5px" class="button" onclick="location.href='<c:url value="/editVehicule"/>'" value="<fmt:message key="button.add"/>"/>
<input type="button" class="button" onclick="location.href='<c:url value="/mainMenu"/>'" value="<fmt:message key="button.done"/>"/>

<script type="text/javascript">
    highlightTableRows("vehiculeList");
</script>
